//
//  TwoManagementCenterViewController.m
//  Ai
//
//  Created by 杜超男 on 2019/3/20.
//  Copyright © 2019年 杜超男. All rights reserved.
//

#import "TwoManagementCenterViewController.h"
#import "StudentManagementViewController.h"//学生管理
#import "ScheduleSettingViewController.h"//课表设置
#import "XLSlideSwitch.h"//滑动滚动第三方
#import "Masonry.h"
@interface TwoManagementCenterViewController ()<XLSlideSwitchDelegate>
@property (nonatomic , strong)XLSlideSwitch *ScrollView;///滚动视图

@end

@implementation TwoManagementCenterViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.view.layer.cornerRadius = 10;
    self.view.layer.masksToBounds = YES;
    //创建一个数组用来存储名字
    NSArray *TitlesArr = @[@"学生管理" , @"课表设置"];
    NSArray *ControllersArr = @[@"StudentManagementViewController" , @"ScheduleSettingViewController"];
    NSMutableArray *ViewControllers = [[NSMutableArray alloc] init];
    for (int i = 0 ; i < TitlesArr.count; i ++) {
        //字符串创建控制器
        UIViewController *VC = [[NSClassFromString(ControllersArr[i])alloc] init];
        [ViewControllers addObject:VC];
    }
    //滚动视图
    _ScrollView = [[XLSlideSwitch alloc] initWithFrame:CGRectMake(0, 16, self.view.bounds.size.width, self.view.bounds.size.height - 64) Titles:TitlesArr viewControllers:ViewControllers];
    _ScrollView.delegate = self;
    //rgba(102/255.0, 102, 102, 1)
    _ScrollView.itemNormalColor = [UIColor colorWithRed:102/255.0 green:102/255.0 blue:102/255.0 alpha:1];
    //rgba(72/255.0, 169/255.0, 54/255.0, 1)
    _ScrollView.itemSelectedColor = [UIColor colorWithRed:72/255.0 green:169/255.0 blue:54/255.0 alpha:1];
    _ScrollView.customTitleSpacing = 30;
    _ScrollView.hideShadow=YES;
    [_ScrollView showInViewController:self];
    _ScrollView.layer.cornerRadius = 10;
    _ScrollView.layer.masksToBounds = YES;
    [_ScrollView mas_remakeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.view.mas_safeAreaLayoutGuideTop).inset(16);
        make.left.mas_equalTo(0);
        make.right.mas_equalTo(0);
        make.bottom.mas_equalTo(self.view.mas_safeAreaLayoutGuideBottom).inset(0);
        
    }];
    // Do any additional setup after loading the view.
}

/*
 #pragma mark - Navigation
 
 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
